package com.example.speedwaymanager;

import java.util.ArrayList;

public class CMatchStats {

	private int _number;
	private int _heatCounter;
	private int _bonuses;
	private int _points;
	private Boolean _tacticalAllowed = true;
	private ArrayList<Integer> _pointsList = new ArrayList<Integer>();
	private ArrayList<Integer> _bonusesList = new ArrayList<Integer>();

	public String getStringPoints() {
		String str = new String();
		for (Integer pts : _pointsList) {
			str += pts.toString() + "";
		}
		return str;
	}

	public int getHeatCount() {
		return _pointsList.size();
	}

	public void addHeatPoints(int i) {
		_pointsList.add(i);
		_points += i;
	}

	public void addHeatBonus() {
		_bonusesList.add(1);
		_bonuses++;
	}

	public void clearPointsAndBonuses() {
		_bonusesList.clear();
		_bonuses = 0;
		_pointsList.clear();
		_points = 0;
	}

	/**
	 * @return the _heatCounter
	 */
	public int get_heatCounter() {
		return _heatCounter;
	}

	/**
	 * @return the _points
	 */
	private Integer reCalculatePoints() {
		_points = 0;
		for (Integer pts : _pointsList) {
			_points += pts;
		}
		return _points;
	}

	/**
	 * @return the _bonuses
	 */
	public Integer get_bonuses() {
		return _bonuses;
	}

	/**
	 * @return the _pointsList
	 */
	public ArrayList<Integer> get_pointsList() {
		return _pointsList;
	}

	/**
	 * @return the _bonusesList
	 */
	public ArrayList<Integer> get_bonusesList() {
		return _bonusesList;
	}

	/**
	 * @return the _number
	 */
	public Integer get_number() {
		return _number;
	}

	/**
	 * @param _number
	 *            the _number to set
	 */
	public void set_number(int _number) {
		this._number = _number;
	}

	/**
	 * @return the points and bonuses
	 */
	public int get_pointsAndBonuses() {
		return get_points() + _bonuses;
	}

	/**
	 * @return the _tacticalAllowed
	 */
	public Boolean get_tacticalAllowed() {
		return _tacticalAllowed;
	}

	/**
	 * @param _tacticalAllowed
	 *            the _tacticalAllowed to set
	 */
	public void set_tacticalAllowed(Boolean _tacticalAllowed) {
		this._tacticalAllowed = _tacticalAllowed;
	}

	/**
	 * @return the _points
	 */
	public Integer get_points() {
		return _points;
	}
}
